<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="keywords" content="" />
<meta name="description" content="" />
<title>在线还款</title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport"content="width=device-width, initial-scale=1, maximum-scale=1">
<script src="../../../js/angular.js"></script>
<link rel="stylesheet" href="../../../layui/css/layui.css" media="all">
<script type="text/javascript" src="../../../layui/lay/modules/layer.js"></script>
<script src="../../../layui/jquery-3.2.1.min.js" charset="utf-8"></script>
<script src="../../../layui/layui.js" charset="utf-8"></script>
<script type="text/javascript" src="../../../dwwsyyt/dw/gjjhbj/fy.js"></script>
<style type="text/css">     
    .mask {       
            position: absolute; top: 0px; filter: alpha(opacity=60); 
            z-index: 1002; left: 0px;              
			background:url(../../../layui/layui/img/jz.gif) no-repeat center rgba(0,0,0,0.5) ;
		  	background-size:30px 30px;
			background-repeat: no-repeat;
			background: 
        }     
	</style>   
</head>
<body>
	<div align="center" id="mask" class="mask"></div>  
	<fieldset class="layui-elem-field layui-field-title"
		style="margin-top: 30px;">
		<legend>请按月还款</legend>
	</fieldset>
	<div ng-app="myApp" ng-controller="customersCtrl" align="center">
	  <div ng-hide="qaqdiv">
		<table class="layui-table" style="width:90%">
			<tr align="center" style="background-color:#f1f1f1">
			    <td ng-hide="true">ID</td>
				<td>操作</td>
				<td>借款人姓名</td>
				<td>应还日期</td>
				<td style="text-align: right;">还款金额</td>
				<td style="text-align: right;">还款本金</td>
				<td style="text-align: right;">还款利息</td>
				<td style="text-align: right;">罚息</td>
				<td style="text-align: right;">违约金</td>
				<td style="text-align: right;">实际还款金额</td>
			</tr>
			<tr ng-repeat="x in names" align="center">
			    <td ng-show="false">{{$index}}</td>
			    <td ng-hide="true">{{x.ID}}</td>
			    <td ><a class="layui-btn layui-btn-normal layui-btn-xs" ng-click="zxhk($index)">我要还款</a></td>
				<td>{{ x.JKRXM }}</td>
				<td>{{ x.YHRQ }}</td>
				<td style="text-align: right;">{{ x.HKJE | currency:"￥"}}</td>
				<td style="text-align: right;">{{ x.HKBJ | currency:"￥"}}</td>
				<td style="text-align: right;">{{ x.HKLX | currency:"￥"}}</td>
				<td style="text-align: right;">{{ x.FX | currency:"￥"}}</td>
				<td style="text-align: right;">{{ x.WYJ | currency:"￥"}}</td>
				<td style="text-align: right;">{{ x.HKJE | currency:"￥"}}</td>
				<td  ng-hide="true">{{ x.HKJHLSH }}</td>	
				<td  ng-hide="true">{{ x.DKZH }}</td>	
				<td  ng-hide="true">{{ x.GSDQDM }}</td>	
				<td  ng-hide="true">{{ x.DQDM }}</td>	
			</tr>
		</table>
		<div class="layui-btn-group">
			<button class="layui-btn layui-btn-primary layui-btn-sm"
				ng-click="Sy()">首页</button>
			<button class="layui-btn layui-btn-primary layui-btn-sm"
				ng-click="Previous()">上一页</button>
			<button ng-repeat="page in pageList"
				class="layui-btn layui-btn-primary layui-btn-sm"
				ng-click="selectPage(page)">{{ page }}</button>
			<button class="layui-btn layui-btn-primary layui-btn-sm"
				ng-click="Next()">下一页</button>
			<button class="layui-btn layui-btn-primary layui-btn-sm"
				ng-click="Wy()">尾页</button>
			<button class="layui-btn layui-btn-primary layui-btn-sm ">{{selPage}}/{{pages}}</button>
		  </div>
		</div>
	</div>
	<script type="text/javascript" src="../../../layui/layui/jquery-3.2.1.min.js"></script>
	<script type="text/javascript">
		function s(){     
        $("#mask").css("height",$(document).height());     
        $("#mask").css("width",$(document).width());     
        $("#mask").show();     
	    }  
	    //隐藏遮罩层  
	    function h(){     
	          
	        $("#mask").hide();     
	    }  
	</script>
	<script>
		layui.use('element', function() {
			var $ = layui.jquery, element = layui.element;
		});
	</script>
	<script type="text/javascript">
	
	function getPath() {  
	     
	        return 'http://'+location.host;
	}
		
		
	</script>
	<script type="text/javascript" src="../../../layui/lay/modules/layer.js"></script>
	<script type="text/javascript" src="../../../layui/layer.ext.js"></script>
	<script type="text/javascript">
	   var a;
	   var data2;
       var app = angular.module('myApp', []);
		    app.controller('customersCtrl', function($scope, $http) {
		    $scope.zxhkdiv=true;
		    s();
			$http({
				url:getPath() + "/wsyyt/zxhkcontroller/test",
				method:'post',
			}).then(
					function(res) {
								h()
								$scope.data = res.data.data;//自己打断点看格式:[{},{}]
								data2=res.data.data;
								
								if(res.data.msg==null){
								
								 	layer.msg("登陆失效请重新登陆");
									setTimeout(function () {
										window.top.location.href=res.data;
									}, 1500);
									return;
								 
								}else if(res.data.code==1){
									    $scope.names="";
										$scope.selPage="";
										$scope.selectPage="";
									 	$scope.pages="";
										$scope.page="";
										$scope.pageList="";
									//layer.msg('提示：'+res.data.CW,{icon: 5});
									layer.alert('提示：'+res.data.CW, {
								      skin: 'layui-layer-molv' //样式类名  自定义样式
								     ,closeBtn: 1    // 是否显示关闭按钮
								      ,anim: 1 //动画类型
								     ,btn: ['确认'] //按钮
								      ,icon: 5    // icon
								     ,btn2:function(){
										
								     }});
								     return null;
								}		
								a = res.data.CNT;
								feny($scope.data);
			});
	$scope.zxhk=function(index){
	if($scope.names[0].YHRQ==data2[index].YHRQ){
	layer.alert('提示：请确认您的还款卡余额充足！', {
								      skin: 'layui-layer-molv' //样式类名  自定义样式
								     ,closeBtn: 1    // 是否显示关闭按钮
								      ,anim: 1 //动画类型
								     ,btn: ['确认','取消'] //按钮
								      ,icon: 6    // icon
								      ,yes:function(){
										 $scope.params = {
		id : $scope.data[index].ID,
		yhrq:$scope.data[index].YHRQ,
		hkje:$scope.data[index].HKJE,
		hkbj:$scope.data[index].HKBJ,
	    fx:$scope.data[index].FX,
		sjhkje:$scope.data[index].SJHKJE,
		dqdm:$scope.data[index].DQDM,
		gsdqdm:$scope.data[index].GSDQDM,
		hkjhlsh:$scope.data[index].HKJHLSH,
		DQDM:$scope.data[index].DQDM,
		GSDQDM:$scope.data[index].GSDQDM,
		DKZH:$scope.data[index].DKZH,
		JKRXM:$scope.data[index].JKRXM,
	 };
	 s();
	 $http({
	   url:getPath() + "/wsyyt/zxhkcontroller/test1",
	   method:'post',
	   params:$scope.params
	 }).then(function(res) {
	 	h();
		if(res.data.msg==null){
								
								 	layer.msg("登陆失效请重新登陆");
									setTimeout(function () {
										window.top.location.href=res.data;
									}, 1500);
									return;
								 
							}else if(res.data.code==0){
		  //layer.msg('提示：还款已受理、请等待审核',{icon: 6});
		  layer.alert('提示：还款已受理、请等待审核', {
								      skin: 'layui-layer-molv' //样式类名  自定义样式
								     ,closeBtn: 1    // 是否显示关闭按钮
								      ,anim: 1 //动画类型
								     ,btn: ['确认'] //按钮
								      ,icon: 6    // icon
								      ,yes:function(){
										window.location.href=window.location.href;
								     }});
		}else{
		   //layer.msg('提示：'+res.data.CW,{icon: 5});
		   
		   layer.alert('提示：'+res.data.CW, {
								      skin: 'layui-layer-molv' //样式类名  自定义样式
								     ,closeBtn: 1    // 是否显示关闭按钮
								      ,anim: 1 //动画类型
								     ,btn: ['确认'] //按钮
								      ,icon: 5    // icon
								      ,yes:function(){
										window.location.href=window.location.href;
								     }});
			
		}
		});
								     }});
	
	}else{
		layer.alert('提示：请您按月还款', {
								      skin: 'layui-layer-molv' //样式类名  自定义样式
								     ,closeBtn: 1    // 是否显示关闭按钮
								      ,anim: 1 //动画类型
								     ,btn: ['确认'] //按钮
								      ,icon: 5    // icon
								     ,btn2:function(){
										
		}});
	}
	};
});	
</script>
</body>
</html>